let p =new Promise((resolve,reject)=>{
   let num=Math.random()*50;//大于0小于50
   if(num>30){
       resolve('num>30')
   }else{
       reject('num<=30')
   }
})

p.then(res=>{
    console.log('resolve',res);
},res=>{
    console.log('reject',res);
})